package com.lcxw.hxzbapi.service;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.dao.mapper.GiftbagMapper;
import com.lcxw.hxzbapi.entity.pojo.YwpdGiftBag;

@Component
public class GiftBagService {

    @Resource
    GiftbagMapper giftbagMapper;

    public int insert(YwpdGiftBag ywpdGiftBag){
        return giftbagMapper.insert(ywpdGiftBag);
    }

    public int deleteByPrimaryKey(Integer id){
        return giftbagMapper.deleteByPrimaryKey(id);
    }

    public YwpdGiftBag selectByPrimaryKey(Integer id){
        return giftbagMapper.selectByPrimaryKey(id);
    }

    public List<YwpdGiftBag> selectByUserId(long userId){
        return giftbagMapper.selectByUserId(userId);
    }

    public YwpdGiftBag selectByUserIdAndGiftId(long userId,int giftId){
        return giftbagMapper.selectByUserIdAndGiftId(userId,giftId);
    }

    public int selectGiftNumByUserIdAndGiftId(long userId,int giftId){
        return giftbagMapper.selectGiftNumByUserIdAndGiftId(userId,giftId);
    }

    public int updateGiftNum(long userId,int giftId,int giftNum){
        return giftbagMapper.updateGiftNum(userId,giftId,giftNum);
    }

    public int updateByPrimaryKey(YwpdGiftBag ywpdGiftBag){
        return giftbagMapper.updateByPrimaryKey(ywpdGiftBag);
    }
}
